package com.juqimiao.raccoon.commodity.api.start;

import com.juqimiao.linn.logging.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(
		scanBasePackages= {
				RaccoonApplication.LINN_PACKAGE,
				RaccoonApplication.APP_PACKAGE
		})
@MapperScan(RaccoonApplication.DB_MODEL_PACKAGE)
public class RaccoonApplication {

	static final String LINN_PACKAGE = "com.juqimiao.linn";
	static final String APP_PACKAGE = "com.juqimiao.raccoon.commodity";
	static final String DB_MODEL_PACKAGE = "com.juqimiao.raccoon.commodity.tunnel.database";
	private static final String BEGIN_LOGGING = "Begin to start raccoon ecommerce Application";
	private static final String END_LOGGING = "End starting Spring Boot Application, Time used: %s";

	private static Logger logger = Logger.getLogger(RaccoonApplication.class);

	public static void main(String[] args) {
		logger.info(BEGIN_LOGGING);

		long startTime = System.currentTimeMillis();

		SpringApplication.run(RaccoonApplication.class, args);

		long endTime = System.currentTimeMillis();
		logger.info(String.format(END_LOGGING, (endTime - startTime)));
	}
}
